/*     */ package com.vehicle.auto.click.business;
/*     */
/*     */ import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.vehicle.auto.click.common.IEDriver;
/*     */ import com.vehicle.auto.click.common.UiJTextArea;
/*     */ import com.vehicle.auto.click.enums.DataBaseVserionEnum;
/*     */ import com.vehicle.auto.click.model.UiVehicleInfo;
import com.vehicle.auto.click.model.VehicleInfo;
/*     */ import com.vehicle.auto.click.service.VehicleInfoService;
/*     */ import java.awt.image.BufferedImage;
/*     */ import java.io.ByteArrayOutputStream;
/*     */ import java.io.DataInputStream;
/*     */ import java.io.File;
/*     */ import java.io.FileInputStream;
/*     */ import java.io.FileOutputStream;
/*     */ import java.io.IOException;
/*     */ import java.io.InputStream;
/*     */ import java.net.MalformedURLException;
/*     */ import java.net.URL;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.time.LocalDate;
/*     */ import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Date;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
/*     */ import javax.imageio.ImageIO;
/*     */ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.collections4.CollectionUtils;
/*     */ import org.apache.commons.io.FileUtils;
/*     */ import org.apache.commons.lang3.StringUtils;
/*     */ import org.apache.tomcat.util.codec.binary.Base64;
/*     */ import org.openqa.selenium.Alert;
/*     */ import org.openqa.selenium.By;
/*     */ import org.openqa.selenium.NoAlertPresentException;
/*     */ import org.openqa.selenium.OutputType;
/*     */ import org.openqa.selenium.Point;
/*     */ import org.openqa.selenium.TakesScreenshot;
/*     */ import org.openqa.selenium.WebDriver;
/*     */ import org.openqa.selenium.WebElement;
/*     */ import org.openqa.selenium.support.ui.ExpectedConditions;
/*     */ import org.openqa.selenium.support.ui.Select;
/*     */ import org.openqa.selenium.support.ui.WebDriverWait;
/*     */ import org.slf4j.Logger;
/*     */ import org.slf4j.LoggerFactory;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.beans.factory.annotation.Value;
/*     */ import org.springframework.stereotype.Service;
/*     */
/*     */ @Service("uIFrameService")
/*     */ public class UIFrameService {
    /*  40 */   public static final Logger log = LoggerFactory.getLogger(com.vehicle.auto.click.business.UIFrameService.class);
    /*     */
    /*     */   @Autowired
    /*     */   VehicleInfoService vehicleInfoService;
    /*     */
    /*  45 */   private String originalWindow = "";
    /*     */
    /*  46 */   private String secondWindow = "";
    /*     */
    /*  47 */   private String thirdWindow = "";
    /*     */
    /*     */   @Value("${vehicle.ui.days}")
    /*     */   private String uiDays;
    /*     */
    /*     */   @Value("${vehicle.office.path}")
    /*     */   private String vehicleOfficePath;
    /*     */
    /*     */   @Value("${ie.exe.path}")
    /*     */   private String iePath;
    /*     */
    /*     */   @Value("${ie.driver.path}")
    /*     */   private String ieDriverPath;
    /*     */
    /*     */   @Value("${user.username}")
    /*     */   private String username;
    /*     */
    /*     */   @Value("${user.password}")
    /*     */   private String password;
    /*     */
    /*     */   @Value("${ie.wait.time}")
    /*     */   private String ieWaitTime;
    /*     */
    /*     */   @Value("${vehicle.is.pass}")
    /*     */   private String vehicleIsPass;

    private ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();

    private String systime = null;

    public interface lib extends Library {
        public static final String property = System.getProperty("user.dir");
        public static final String s_path = property.substring(0, property.lastIndexOf(StringPool.BACK_SLASH)) + "\\ui_32\\read_verify_code\\read_verify_code.dll";
        public static final lib instance = (lib) Native.loadLibrary(s_path, lib.class);

        String read_verify_code(String s_image, String s_path2);
    }

    public void getSystemDate(){
        String serverTime = null;

        try {
            OkHttpClient client = new OkHttpClient().newBuilder().build();
            Request request = new Request.Builder()
                    .url("http://172.26.249.20:9080/getSysTime")
                    .method("GET", null) // GET请求通常不需要设置RequestBody
                    .build();

            Response response = client.newCall(request).execute();

            // 检查响应状态码
            if (!response.isSuccessful()) {
                throw new IOException("Unexpected code " + response);
            }

            // 打印响应体

            serverTime = response.body().string();
            System.out.println("服务器时间：" + serverTime);
            systime = serverTime;

        } catch (IOException e) {
            // 使用日志框架记录异常信息
            // log.error("Error occurred while making HTTP request", e);
            System.out.println(e);
            System.out.println("获取时间错误");
            throw new RuntimeException(e);
        }

    };

    /*     */
    /*     */   public void startButton(String databaseVersion) {
                        System.out.println("进入方法");
                        executorService.shutdownNow(); // 这一步会中断正在执行的任务，如果你不想中断，可以省略
                        executorService = Executors.newSingleThreadScheduledExecutor();
                        executorService.scheduleAtFixedRate(() -> {
                            this.getSystemDate();
                        }, 60 * 1000 * 10, 60 * 1000 * 10, TimeUnit.MILLISECONDS);

                        this.getSystemDate();
                        System.out.println(systime);

        /* 102 */     System.setProperty("webdriver.ie.driver", this.ieDriverPath);
        /* 104 */     System.setProperty("webdriver.ie.bin", this.iePath);
        /* 106 */     IEDriver.ieDriver = null;
        /* 107 */     IEDriver iEDriver = IEDriver.getIEDriver();
        /* 109 */     iEDriver.manage().window().maximize();
        /* 112 */     int waitTime = Integer.parseInt(this.ieWaitTime.trim());
        /*     */     try {
            /* 116 */       iEDriver.get(this.vehicleOfficePath);
            /* 118 */       this.originalWindow = iEDriver.getWindowHandle();
            /* 121 */       Boolean login_flag = Boolean.valueOf(true);
            /* 122 */       while (login_flag.booleanValue()) {
                /* 124 */         WebElement yhdh = iEDriver.findElement(By.name("yhdh"));
                /* 125 */         yhdh.clear();
                /* 126 */         yhdh.sendKeys(new CharSequence[] { this.username.trim() });
                /* 128 */         WebElement mm = iEDriver.findElement(By.name("mm"));
                /* 129 */         mm.clear();
                /* 130 */         mm.sendKeys(new CharSequence[] { this.password.trim() });
                /* 132 */         String property = System.getProperty("user.dir");
                /* 133 */         String s_path = property.substring(0, property.lastIndexOf("\\")) + "\\ui_32\\read_verify_code\\";
                /* 135 */         System.out.println("获取到s_path:" + s_path);
                /* 136 */         String imgBase64 = null;
                /*     */         try {
                    /* 139 */           Thread.sleep(1000L);
                    /* 140 */           WebElement yzm_element = iEDriver.findElement(By.xpath("//iframe[contains(@src,'login.frm?method=getVadidateImageJs')]"));
                    /* 141 */           String yanZhengMa = downloadYanZhengMa(yzm_element, (WebDriver)iEDriver);
                    /* 142 */           imgBase64 = getImgBase64(yanZhengMa);
                    /* 143 */           System.out.println("获取到图片验证码imgBase64:" + imgBase64);
                    /* 144 */         } catch (Exception e) {
                    /* 145 */           e.printStackTrace();
                    /* 146 */           System.out.println("获取到图片验证码imgBase64失败");
                    /*     */         }
                /* 149 */         System.out.println("开始识别验证码================");
                /* 150 */         String verify_code = null;
                /*     */         try {
                    /* 152 */           verify_code = lib.instance.read_verify_code(imgBase64, s_path);
                    /* 153 */         } catch (Exception e) {
                    /* 154 */           e.printStackTrace();
                    /* 155 */           System.out.println("验证码识别报错");
                    /*     */         }
                /* 157 */         Thread.sleep(1000L);
                /* 159 */         System.out.println("获取到验证码" + verify_code);
                /* 161 */         WebElement yzm = iEDriver.findElement(By.name("yzm"));
                /* 162 */         yzm.clear();
                /* 163 */         yzm.sendKeys(new CharSequence[] { verify_code });
                /* 164 */         Thread.sleep(1000L);
                /* 167 */         WebElement submit = iEDriver.findElement(By.name("Submit"));
                /* 168 */         submit.click();
                /*     */         try {
                    /* 172 */           WebElement frame = (WebElement)(new WebDriverWait((WebDriver)iEDriver, 10L)).until((Function)ExpectedConditions.elementToBeClickable(By.xpath("//*[@id='leftfrm']")));
                    /* 173 */           login_flag = Boolean.valueOf(false);
                    /* 174 */         } catch (Exception e) {
                    /* 175 */           e.printStackTrace();
                    /* 176 */           iEDriver.navigate().refresh();
                    /* 177 */           Thread.sleep(2000L);
                    /*     */         }
                /*     */       }
            /* 184 */       Set<String> windowHandles = iEDriver.getWindowHandles();
            /* 196 */       iEDriver.switchTo().frame("leftfrm");
            /* 197 */       WebElement clshLink = (WebElement)(new WebDriverWait((WebDriver)iEDriver, 10L)).until(dr -> dr.findElement(By.linkText("车辆检验审核")));
            /* 200 */       clshLink.click();
            /* 204 */       for (String windowHandle : iEDriver.getWindowHandles()) {
                /* 205 */         if (!this.originalWindow.contentEquals(windowHandle)) {
                    /* 206 */           iEDriver.switchTo().window(windowHandle);
                    /* 207 */           this.secondWindow = windowHandle;
                    /*     */           break;
                    /*     */         }
                /*     */       }
            /* 212 */     } catch (Exception e) {
            /* 213 */       e.printStackTrace();
            /*     */     }
        /*     */     while (true) {
            /* 219 */       String dbVersion = databaseVersion;
            /* 220 */       Map<String, Object> req = new HashMap<>();
            /* 221 */       if (StringUtils.isNotBlank(this.vehicleIsPass) && this.vehicleIsPass.equals("2")) {
                /* 222 */         req.put("allPass", "2");
                /*     */       } else {
                /* 224 */         req.put("isPass", "1");
                /*     */       }
            /* 226 */       req.put("center_status", "0");
                            DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE;
                            LocalDate date = LocalDate.parse(systime, formatter);
                            System.out.println("当前查询时间 + " + date.minus(Long.valueOf(this.uiDays).longValue(), ChronoUnit.DAYS) + " 00:00:00");
            /* 227 */       req.put("created_at_gteq", date.minus(Long.valueOf(this.uiDays).longValue(), ChronoUnit.DAYS) + " 00:00:00");
            /* 228 */       req.put("created_at_lteq", date + " 23:59:59");
            /* 229 */       List<VehicleInfo> vehicleInfos = new ArrayList<>();
            /* 230 */       if (StringUtils.isNotBlank(dbVersion) && dbVersion.equals(DataBaseVserionEnum.old_database_version.getCode())) {
                /* 231 */         vehicleInfos = this.vehicleInfoService.queryVehicleChecks(req);
                /*     */       } else {
                /* 233 */         vehicleInfos = this.vehicleInfoService.queryVehicleInfos(req);
                /*     */       }
            /* 237 */       if (CollectionUtils.isNotEmpty(vehicleInfos)) {
                /* 238 */         for (int i = 0; i < vehicleInfos.size(); i++) {
                    /*     */           try {
                        /* 240 */             VehicleInfo vehicleInfo = vehicleInfos.get(i);
                        /* 242 */             iEDriver.switchTo().window(this.secondWindow);
                        /* 243 */             iEDriver.navigate().refresh();
                        /* 246 */             System.out.println("正在审核车辆号牌" + vehicleInfo.getCopy_text());
                        /* 249 */             Select sfdm = new Select(iEDriver.findElement(By.name("sfdm")));
                        /* 251 */             sfdm.selectByValue(vehicleInfo.getCopy_text().substring(0, 1));
                        /* 253 */             WebElement hphm2 = iEDriver.findElement(By.name("hphm2"));
                        /* 254 */             hphm2.clear();
                        /* 255 */             hphm2.sendKeys(new CharSequence[] { vehicleInfo.getHphm() });
                        /* 257 */             WebElement submit3 = iEDriver.findElement(By.name("submit3"));
                        /* 258 */             submit3.click();
                        /* 262 */             UiJTextArea.appendJTextArea(vehicleInfo.getCopy_text() + "正在点击审核...");
                        /* 263 */             Thread.sleep(500L);
                        /* 266 */             iEDriver.switchTo().frame("subFrame");
                        /* 269 */             WebElement list_body_tr_2 = null;
                        /*     */             try {
                            /* 271 */               list_body_tr_2 = (WebElement)(new WebDriverWait((WebDriver)iEDriver, waitTime)).until(dr -> dr.findElement(By.className("list_body_tr_2")));
                            /* 272 */             } catch (Exception e) {
                            /* 273 */               updateCenterStatus(vehicleInfo.getId(), dbVersion);
                            /* 274 */               UiJTextArea.appendJTextArea(vehicleInfo.getCopy_text() + "人工审核完毕\r\n");
                            /*     */             }
                        /* 278 */             list_body_tr_2.click();
                        /* 281 */             System.out.println("点击进入车辆信息此时句柄个数" + iEDriver.getWindowHandles().size());
                        /* 283 */             Thread.sleep(500L);
                        /*     */             try {
                            /* 285 */               for (int j = 0; j < 2; j++) {
                                /* 286 */                 Alert alert = iEDriver.switchTo().alert();
                                /* 287 */                 alert.accept();
                                /* 288 */                 Thread.sleep(500L);
                                /*     */               }
                            /* 290 */             } catch (NoAlertPresentException e) {
                            /* 291 */               System.out.println("异常弹窗处理完毕1");
                            /*     */             }
                        /* 293 */             System.out.println("点击进入车辆信息此时句柄个数" + iEDriver.getWindowHandles().size());
                        /* 295 */             if (iEDriver.getWindowHandles().size() >= 3)
                            /* 296 */               for (String windowHandle : iEDriver.getWindowHandles()) {
                                /* 297 */                 if (!this.originalWindow.contentEquals(windowHandle) && !this.secondWindow.contentEquals(windowHandle)) {
                                    /*     */                   try {
                                        /* 299 */                     System.out.println("进入句柄循环1");
                                        /* 300 */                     iEDriver.switchTo().window(windowHandle);
                                        /* 302 */                     Thread.sleep(500L);
                                        /*     */                     try {
                                            /* 304 */                       for (int j = 0; j < 2; j++) {
                                                /* 305 */                         Alert alert = iEDriver.switchTo().alert();
                                                /* 306 */                         alert.accept();
                                                /* 307 */                         Thread.sleep(500L);
                                                /*     */                       }
                                            /* 309 */                     } catch (Exception e) {
                                            /* 310 */                       e.printStackTrace();
                                            /* 311 */                       System.out.println("异常弹窗处理完毕2");
                                            /*     */                     }
                                        /*     */                     try {
                                            /* 316 */                       (new WebDriverWait((WebDriver)iEDriver, waitTime)).until(dri -> dri.findElement(By.xpath("//*[@name='paramIframe_vehicle']")));
                                            /* 317 */                     } catch (Exception e) {
                                            /* 318 */                       System.out.println("该弹窗没有确定按钮");
                                            /* 319 */                       iEDriver.close();
                                            /*     */                       continue;
                                            /*     */                     }
                                        /* 324 */                     iEDriver.switchTo().frame("paramIframe_vehicle");
                                        /* 326 */                     Integer is_pass = vehicleInfo.getIs_pass();
                                        /* 327 */                     (new WebDriverWait((WebDriver)iEDriver, waitTime)).until((Function)ExpectedConditions.elementToBeClickable(iEDriver.findElement(By.xpath("//*[@name='submit2']"))));
                                        /* 329 */                     if (is_pass.intValue() == 1) {
                                            /* 330 */                       alertProcess((WebDriver)iEDriver, waitTime);
                                            /*     */                     } else {
                                            /* 335 */                       Select shbj = new Select(iEDriver.findElement(By.id("shbj")));
                                            /* 337 */                       shbj.selectByValue("2");
                                            /* 339 */                       Select shbtgyydl = new Select(iEDriver.findElement(By.name("shbtgyydl")));
                                            /* 340 */                       shbtgyydl.selectByIndex(2);
                                            /* 341 */                       Thread.sleep(1000L);
                                            /* 342 */                       Select shbtgyyfl = new Select(iEDriver.findElement(By.name("shbtgyyfl")));
                                            /* 343 */                       shbtgyyfl.selectByIndex(1);
                                            /* 344 */                       Thread.sleep(1000L);
                                            /* 345 */                       Select shbtgyydm = new Select(iEDriver.findElement(By.name("shbtgyydm")));
                                            /* 346 */                       shbtgyydm.selectByIndex(1);
                                            /* 348 */                       WebElement shyj = iEDriver.findElement(By.name("shyj"));
                                            /* 349 */                       shyj.clear();
                                            /* 350 */                       shyj.sendKeys(new CharSequence[] { "自动审核不通过," + vehicleInfo.getIsPassReason() });
                                            /* 351 */                       alertProcess((WebDriver)iEDriver, waitTime);
                                            /*     */                     }
                                        /* 355 */                   } catch (Exception e) {
                                        /* 356 */                     e.printStackTrace();
                                        /* 357 */                     System.out.println("进入catch块");
                                        /*     */                   }
                                    /*     */                   try {
                                        /* 361 */                     iEDriver.close();
                                        /* 362 */                   } catch (Exception e) {
                                        /* 363 */                     System.out.println("页面已自动关闭");
                                        /*     */                   }
                                    /*     */                 }
                                /*     */               }
                        /* 369 */             Thread.sleep(500L);
                        /* 371 */             updateCenterStatus(vehicleInfo.getId(), dbVersion);
                        /* 372 */             UiJTextArea.appendJTextArea(vehicleInfo.getCopy_text() + "审核完毕\r\n");
                        /* 373 */           } catch (Exception e) {
                        /* 374 */             e.printStackTrace();
                        /* 375 */             System.out.println("此条车辆异常" + ((VehicleInfo)vehicleInfos.get(i)).getCopy_text());
                        /*     */           }
                    /*     */         }
                /*     */         continue;
                /*     */       }
            /*     */       try {
                /* 381 */         iEDriver.switchTo().window(this.secondWindow);
                /* 382 */         iEDriver.navigate().refresh();
                /* 383 */         Thread.sleep(15000L);
                /* 384 */       } catch (Exception e) {
                /* 385 */         e.printStackTrace();
                /* 386 */         System.out.println("else里的exception");
                /*     */       }
            /*     */     }
        /*     */   }
    /*     */
    /*     */   public void alertProcess(WebDriver driver, int waitTime) throws Exception {
        /* 401 */     WebElement submit2 = driver.findElement(By.xpath("//*[@name='submit1']"));
        /* 402 */     submit2.click();
        /*     */     try {
            /* 404 */       Alert until = (Alert)(new WebDriverWait(driver, waitTime)).until((Function)ExpectedConditions.alertIsPresent());
            /* 405 */       System.out.println("确定按钮弹窗是否为空：" + ((null != until) ? until.getText() : "为空"));
            /* 406 */     } catch (Exception e) {
            /* 407 */       submit2.click();
            /* 408 */       System.out.println("第二次点击");
            /* 409 */       Thread.sleep(1000L);
            /*     */     }
        /* 413 */     Thread.sleep(1000L);
        /*     */     try {
            /* 415 */       for (int j = 0; j < 2; j++) {
                /* 416 */         Alert alert = driver.switchTo().alert();
                /* 417 */         alert.accept();
                /* 418 */         Thread.sleep(500L);
                /*     */       }
            /* 420 */     } catch (Exception e) {
            /* 421 */       System.out.println("异常弹窗处理完毕3");
            /*     */     }
        /*     */   }
    /*     */
    /*     */   public void StopUIButton() {
        /* 433 */     IEDriver ieDriver = IEDriver.getIEDriver();
        /* 434 */     for (String winHandle : ieDriver.getWindowHandles()) {
            /* 435 */       ieDriver.switchTo().window(winHandle);
            /* 436 */       ieDriver.close();
            /*     */     }
        /* 438 */     IEDriver.ieDriver = null;
        /* 439 */     UiJTextArea.appendJTextArea("自动审核工具已停止\r\n");
        /*     */   }
    /*     */
    /*     */   public void updateCenterStatus(String id, String dbVersion) {
        /* 448 */     Map<String, Object> update = new HashMap<>();
        /* 449 */     update.put("uuid", id);
        /* 450 */     update.put("center_status", "1");
        /* 451 */     if (StringUtils.isNotBlank(dbVersion) && dbVersion.equals(DataBaseVserionEnum.old_database_version.getCode())) {
            /* 452 */       this.vehicleInfoService.updateVehicleChecks(update);
            /*     */     } else {
            /* 454 */       this.vehicleInfoService.updateVehicleInfos(update);
            /*     */     }
        /*     */   }
    /*     */
    /*     */   private String downloadYanZhengMa(WebElement ele, WebDriver _driver) throws Exception {
        /* 467 */     File screenshot = (File)((TakesScreenshot)_driver).getScreenshotAs(OutputType.FILE);
        /* 468 */     BufferedImage fullImg = ImageIO.read(screenshot);
        /* 469 */     Point point = ele.getLocation();
        /* 471 */     int eleWidth = ele.getSize().getWidth() - 75;
        /* 472 */     int eleHeight = ele.getSize().getHeight();
        /* 473 */     BufferedImage eleScreenshot = fullImg.getSubimage(point.getX() + 3, point.getY() + 2, eleWidth, eleHeight);
        /* 474 */     ImageIO.write(eleScreenshot, "png", screenshot);
        /* 475 */     SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
        /* 476 */     String filename = "yanzhengma/yanzhengma_" + df.format(new Date()) + ".png";
        /* 477 */     File screenshotLocation = new File(filename);
        /* 478 */     FileUtils.copyFile(screenshot, screenshotLocation);
        /* 479 */     return filename;
        /*     */   }
    /*     */
    /*     */   private void downloadPicture(String urlList, String path) {
        /* 487 */     URL url = null;
        /* 488 */     String encode = "";
        /*     */     try {
            /* 490 */       url = new URL(urlList);
            /* 491 */       DataInputStream dataInputStream = new DataInputStream(url.openStream());
            /* 493 */       FileOutputStream fileOutputStream = new FileOutputStream(new File(path));
            /* 494 */       ByteArrayOutputStream output = new ByteArrayOutputStream();
            /* 496 */       byte[] buffer = new byte[1024];
            /*     */       int length;
            /* 499 */       while ((length = dataInputStream.read(buffer)) > 0)
                /* 500 */         output.write(buffer, 0, length);
            /* 503 */       encode = new String(Base64.encodeBase64(buffer));
            /* 504 */       System.out.println(encode);
            /* 505 */       fileOutputStream.write(output.toByteArray());
            /* 506 */       dataInputStream.close();
            /* 507 */       fileOutputStream.close();
            /* 508 */     } catch (MalformedURLException e) {
            /* 509 */       e.printStackTrace();
            /* 510 */     } catch (IOException e) {
            /* 511 */       e.printStackTrace();
            /*     */     }
        /*     */   }
    /*     */
    public UiVehicleInfo selectVehicle(String databaseVersion, String hphm, String time_start, String time_end) {
        Integer passNum;
        Integer noPassNum;
        List<VehicleInfo> vehicleInfos;
        UiVehicleInfo uiVehicleInfo = new UiVehicleInfo();
        Map<String, Object> req = new HashMap<>();
        req.put("isPass", "1");
        req.put("center_status", "1");
        if (StringUtils.isNotBlank(time_start)) {
            req.put("created_at_gteq", time_start + " 00:00:00");
        } else {
            req.put("created_at_gteq", LocalDate.now() + " 00:00:00");
        }
        if (StringUtils.isNotBlank(time_end)) {
            req.put("created_at_lteq", time_end + " 23:59:59");
        } else {
            req.put("created_at_lteq", LocalDate.now() + " 23:59:59");
        }
        if (StringUtils.isNotBlank(databaseVersion) && databaseVersion.equals(DataBaseVserionEnum.old_database_version.getCode())) {
            passNum = this.vehicleInfoService.quertVehicleCheckCount(req);
        } else {
            passNum = this.vehicleInfoService.queryVehicleInfoCount(req);
        }
        uiVehicleInfo.setPassNum(passNum);
        req.put("isPass", "0");
        if (StringUtils.isNotBlank(databaseVersion) && databaseVersion.equals(DataBaseVserionEnum.old_database_version.getCode())) {
            noPassNum = this.vehicleInfoService.quertVehicleCheckCount(req);
        } else {
            noPassNum = this.vehicleInfoService.queryVehicleInfoCount(req);
        }
        uiVehicleInfo.setNoPassNum(noPassNum);
        req.put("isPass", null);
        req.put("allPass", "1");
        req.put("hphm_cont", hphm.trim());
        new ArrayList();
        if (StringUtils.isNotBlank(databaseVersion) && databaseVersion.equals(DataBaseVserionEnum.old_database_version.getCode())) {
            vehicleInfos = this.vehicleInfoService.queryVehicleChecks(req);
        } else {
            vehicleInfos = this.vehicleInfoService.queryVehicleInfos(req);
        }
        uiVehicleInfo.setList(vehicleInfos);
        return uiVehicleInfo;
    }


    /*     */   public static String getImgBase64(String imgFile) {
        /* 522 */     InputStream in = null;
        /* 523 */     byte[] data = null;
        /*     */     try {
            /* 527 */       in = new FileInputStream(imgFile);
            /* 528 */       data = new byte[in.available()];
            /* 529 */       in.read(data);
            /* 530 */       in.close();
            /* 532 */     } catch (IOException e) {
            /* 534 */       e.printStackTrace();
            /*     */     }
        /* 536 */     return new String(Base64.encodeBase64(data));
        /*     */   }
    /*     */ }




/* Location:              /Users/zhao/Desktop/java/ui_32/旧JAR/vehicle-auto-click-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes/com/vehicle/auto/click/business/UIFrameService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */